package com.example.springboot.Service;

import com.example.springboot.entity.Schedule;
import com.example.springboot.mapper.ScheduleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ScheduleSave {
    @Autowired
    private ScheduleMapper scheduleMapper ;
    public List<Schedule> ScheduleSave( Integer id){
        List<Schedule> schedules = scheduleMapper.selectStudentCourse(id);

        schedules.forEach(schedule -> schedule.setMsg(scheduleMapper.Schedule_msg(schedule.getCourse_id())));  // 用课程号查询类别
        schedules.forEach(schedule -> schedule.setTeacherName(scheduleMapper.teacherName(schedule.getJob_id())));  //
        return schedules;

    }

}
